package com.libs.utils;

import com.libs.sys.model.Userseat;
import com.libs.sys.service.LibService;
import com.libs.sys.service.impl.LibServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author yzr07
 */
@Component
@EnableScheduling
@Slf4j
public class Timer {
    private final LibService libService = new LibServiceImpl();


    @Scheduled(cron = "30 32 5  * * ?")
    public void signSeat() throws Exception {
        final List<Userseat> userSeatList = UserSeatUtils.getUserSeatList();
        libService.listSign(userSeatList);
//
    }

    @Scheduled(cron = "0 28 5  * * ?")
    public void getSeat() throws InterruptedException {
        final List<Userseat> userSeatList = UserSeatUtils.getUserSeatList();
        libService.listExe(userSeatList);
    }

//    @Scheduled(cron = "0 * *  * * ?")
//    public void test() throws Exception {
//        final List<Userseat> userSeatList = UserSeatUtils.getUserSeatList();
//        System.out.println(libService.login(userSeatList.get(0),HttpClientConn.getHttpClient()));
//    }

}
